#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
#define rep(i, a, b) for (int i = (a); i <= (b); i++)
#define per(i, a, b) for (int i = (a); i >= (b); i--)
#define endl '\n'
const int N = 2e5 + 5;

int n, m;
int a[N];
int r[N], sz[N], num;

int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cin >> n;
  rep(i, 1, n) cin >> a[i];
  sort(a + 1, a + n + 1);
  rep(i, 1, n) {
    int pos = lower_bound(r + 1, r + num + 1, a[i]) - r - 1;
    if (pos >= 1 && r[pos] == a[i] - 1) {
      r[pos]++, sz[pos]++;
    } else {
      ++num;
      r[num] = a[i], sz[num] = 1;
    }
  }
  cout << *min_element(sz + 1, sz + num + 1);
  return 0;
}